﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FortuneHeaven.Admin.Common;
using FortuneHeavenBAL;
using FortuneHeavenCommon.DataMap;

namespace FortuneHeaven.Admin.Pages.GameManager
{
    public partial class UserInforDetail_Score : FortuneHeaven.Admin.Common.PageBase
    {

        public override string PageID
        {
            get { return "F56"; }
        }
        private string pre = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (ID >= 0)
                {
                    AccountsInfoBO bo = new AccountsInfoBO();
                    AccountsInfo g = bo.GetAcount(ID);

                    this.lbAcount.Text = g.RegAccounts;
                    this.lbGameID.Text = g.GameID.ToString();

                    GameScoreInfoBO gameBO = new GameScoreInfoBO();
                    GameScoreInfo game = gameBO.GetGameScore(ID);
                    if (game != null)
                    {
                        this.lbAllLogonTimes.Text = game.AllLogonTimes.ToString();
                        this.lbDrawCount.Text = game.DrawCount.ToString();

                        this.lbFleeCount.Text = game.FleeCount.ToString();
                        this.lbInsurance.Text = game.InsureScore.ToString();
                        this.lbLastLogonDate.Text = game.LastLogonDate.ToString();
                        this.lbLastLogonIP.Text = game.LastLogonIP.ToString();
                        this.lbLoseCount.Text = game.LostCount.ToString();
                        this.lbOnLineTimeCount.Text = game.OnLineTimeCount.ToString();
                        this.lbPlayTimeCount.Text = game.PlayTimeCount.ToString();
                        this.lbRevenue.Text = game.Revenue.ToString();
                        this.lbScore.Text = game.Score.ToString();
                        this.lbWinCount.Text = game.WinCount.ToString();
                    }
                }
            }
        }

        public new int ID
        {
            get
            {
                return string.IsNullOrEmpty(Request["ID"]) ? -1 : int.Parse(Request["ID"]);
            }
        }

        public string Pre
        {
            get
            {
                if (!string.IsNullOrEmpty(pre))
                    return pre;
                else
                    pre = Server.UrlDecode(Request["pre"]);
                return pre;
            }
        }


        public void CancelSave(object sender, EventArgs arg)
        {
            if (!string.IsNullOrEmpty(Pre))
            {
                Response.Redirect(Pre);
            }
        }
    }
}